import React, { Component } from "react";

export default class Child extends Component {
//   state = {
//     users: [
//       { id: 1, name: "Jack", age: "18", sex: "male" },
//       { id: 2, name: "Tom", age: "22", sex: "male" },
//       { id: 3, name: "Tyler", age: "33", sex: "female" },
//     ],
//   };
state = {
    users: 'abc'
}
  render() {
    const { users } = this.state;
    return (
      <div>
        <h3>我是Child组件</h3>
        <ul>
          {users.map((user) => {
            return (
              <li key={user.id}>
                {user.name},{user.age},{user.sex}
              </li>
            );
          })}
        </ul>
      </div>
    );
  }
}
